package mock.servicesdirectory.organisations.web.action;

import mock.servicesdirectory.organisations.business.businessimpl.OrganisationBOImpl;

import com.opensymphony.xwork2.ActionSupport;

public class OrganisationDetailAction extends ActionSupport {
	
	
	// Name of Organisation . Value is field of organisationName in detail1.jsp
	private String organisationName;
	// Postcode 
	private String postCode;
	// Is active fields
	private boolean isActive;
	// Short Description
	private String shortDescription;
	//expression Of Interest
	private boolean expressionOfInterest;
	//type Of Business
	private String typeOfBussiness;
	//Lead Contact
	private String leadContact;
	//sicCode
	private String sicCode;
	//addressLine1
	private String addressLine1;
	//addressLine2
	private String addressLine2;
	//organisation Full Description
	private String organisationFullDescription;
	//address Line 3
	private String addressLine3;
	//phone Number
	private int phoneNumber;
	//fax
	private int fax;
	//city Town
	private String cityTown;
	//email
	private String email;
	//county
	private String county;
	//webAddress
	private String webAddress;
	//nation
	private String nation;
	//charity Number
	private int charityNumber;
	//company Number
	private int companyNumber;
	private static boolean iseditmode = false;
	public String getOrganisationName() {
		return organisationName;
	}

	public void setOrganisationName(String organisationName) {
		this.organisationName = organisationName;
	}

	public String getPostCode() {
		return postCode;
	}

	public void setPostCode(String postCode) {
		this.postCode = postCode;
	}

	public boolean isActive() {
		return isActive;
	}

	public void setActive(boolean isActive) {
		this.isActive = isActive;
	}

	public String getShortDescription() {
		return shortDescription;
	}

	public void setShortDescription(String shortDescription) {
		this.shortDescription = shortDescription;
	}

	public boolean isExpressionOfInterest() {
		return expressionOfInterest;
	}

	public void setExpressionOfInterest(boolean expressionOfInterest) {
		this.expressionOfInterest = expressionOfInterest;
	}

	public String getTypeOfBussiness() {
		return typeOfBussiness;
	}

	public void setTypeOfBussiness(String typeOfBussiness) {
		this.typeOfBussiness = typeOfBussiness;
	}

	public String getLeadContact() {
		return leadContact;
	}

	public void setLeadContact(String leadContact) {
		this.leadContact = leadContact;
	}

	public String getSicCode() {
		return sicCode;
	}

	public void setSicCode(String sicCode) {
		this.sicCode = sicCode;
	}

	public String getAddressLine1() {
		return addressLine1;
	}

	public void setAddressLine1(String addressLine1) {
		this.addressLine1 = addressLine1;
	}

	public String getAddressLine2() {
		return addressLine2;
	}

	public void setAddressLine2(String addressLine2) {
		this.addressLine2 = addressLine2;
	}

	public String getOrganisationFullDescription() {
		return organisationFullDescription;
	}

	public void setOrganisationFullDescription(String organisationFullDescription) {
		this.organisationFullDescription = organisationFullDescription;
	}

	public String getAddressLine3() {
		return addressLine3;
	}

	public void setAddressLine3(String addressLine3) {
		this.addressLine3 = addressLine3;
	}

	public int getPhoneNumber() {
		return phoneNumber;
	}

	public void setPhoneNumber(int phoneNumber) {
		this.phoneNumber = phoneNumber;
	}

	public int getFax() {
		return fax;
	}

	public void setFax(int fax) {
		this.fax = fax;
	}

	public String getCityTown() {
		return cityTown;
	}

	public void setCityTown(String cityTown) {
		this.cityTown = cityTown;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getCounty() {
		return county;
	}

	public void setCounty(String county) {
		this.county = county;
	}

	public String getWebAddress() {
		return webAddress;
	}

	public void setWebAddress(String webAddress) {
		this.webAddress = webAddress;
	}

	public String getNation() {
		return nation;
	}

	public void setNation(String nation) {
		this.nation = nation;
	}

	public int getCharityNumber() {
		return charityNumber;
	}

	public void setCharityNumber(int charityNumber) {
		this.charityNumber = charityNumber;
	}

	public int getCompanyNumber() {
		return companyNumber;
	}

	public void setCompanyNumber(int companyNumber) {
		this.companyNumber = companyNumber;
	}

	
	public String getOrganisationname() {
		return organisationName;
	}

	public void setOrganisationname(String organisationname) {
		this.organisationName = organisationname;
	}
	public String save(){
		
		return SUCCESS;
	}
	
	public String back(){
		return SUCCESS;
	}
	
	// Method to set a organisation to deactive
	public String deactive(){
		// Call OrganisationBOImpl.updateStatus
		return SUCCESS;
	}
	
	// Method to join 6 tabs in OrganisationDetail.jsp
	public String detail1(){
		return SUCCESS;
	}
	
	public String detail2(){
		return SUCCESS;
	}
	
	public String detail3(){
		return SUCCESS;
	}
	public String detail4(){
		return SUCCESS;
	}
	public String detail5(){
		return SUCCESS;
	}
	public String detail6(){
		return SUCCESS;
	}
	
	// To check Postcode is exist in database or not
	public String checkPostCode(){
		// Call ContactBOImpl.checkExistPostCode to check Postcode 
		
		// Return Success if Postcode is exist
	
		// Return Error if postcode is not exist
		return SUCCESS;
	}
	
	//Organisation name is not null 
	
	public boolean checkOrganisationName(String orgname) {
		// TODO Auto-generated method stub
		if(orgname.length()== 0){
			return false;
		}
		else{
			return true;
		}
	}

	
	// Organisation name is exist in database or not ?
	public boolean checkExistOrganisation(String orgname) {
		// TODO Auto-generated method stub
		// Call method checkExistOrganisation of OrganisationDAO and return true if this name is exist in database
		
		return false;
	}

	
	// Postcode is exist in database or not ?
	public boolean checkPostCode(int postcode) {
		// TODO Auto-generated method stub
		// Call Method checkPostcode in ContactDAO to check and return true if postcode is exist in database
		return false;
	}

	
	// Addressline is not nulll 
	public boolean checkAddressLine1(String addressline1) {
		// TODO Auto-generated method stub
		if(addressline1.length()==0){
		return false;
		}
		else{
			return true;
		}
	}


	// Phone number is not null
	public boolean checkPhoneNumber(String phonenumber) {
		// TODO Auto-generated method stub
		if(phonenumber.length()==0){
		return false;
		}
		else{
			return true;
		}
	}

	// Organisation Short Description is not null 
	public boolean checkOrgShortDesc(String orgshortdesc) {
		// TODO Auto-generated method stub
		if(orgshortdesc.length() == 0){
			return false;
		}
		else{
		return true;
		}
	}

}
